﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using RealState.Utils;

namespace RealState.W
{
    public partial class RegUserMnt : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            FileStream fileStream;

            try
            {

                fileStream = new FileStream(Server.MapPath("~") + "ReadState.dat", FileMode.Append, FileAccess.Write, FileShare.Read);

                StreamWriter writeStream = new StreamWriter(fileStream);

                writeStream.WriteLine(txtUsername.Text + "," + Converter.MD5Encrypt(txtPassword.Text) + "," + txtEmail.Text + "," + DropDownList1.SelectedValue);

                writeStream.Close();

            }

            catch (Exception ex)
            {
                throw ex;
            }

        }
        

    }
}
